Integrand size = 27, antiderivative size = 228 \[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=-\frac {b^2 \cos (e+f x) \sin (e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (2+n p)}+\frac {\left (b^2 (1+n p)+9 (2+n p)\right ) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1+n p),\frac {1}{2} (3+n p),\sin ^2(e+f x)\right ) \sin (e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (1+n p) (2+n p) \sqrt {\cos ^2(e+f x)}}+\frac {6 b \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (2+n p),\frac {1}{2} (4+n p),\sin ^2(e+f x)\right ) \sin ^2(e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (2+n p) \sqrt {\cos ^2(e+f x)}} \]
[Out]
Time = 0.17 (sec) , antiderivative size = 221, normalized size of antiderivative = 0.97, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {2905, 2868, 2722, 3093} \[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=\frac {\left (\frac {a^2}{n p+1}+\frac {b^2}{n p+2}\right ) \sin (e+f x) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (n p+1),\frac {1}{2} (n p+3),\sin ^2(e+f x)\right ) \left (c (d \sin (e+f x))^p\right )^n}{f \sqrt {\cos ^2(e+f x)}}+\frac {2 a b \sin ^2(e+f x) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (n p+2),\frac {1}{2} (n p+4),\sin ^2(e+f x)\right ) \left (c (d \sin (e+f x))^p\right )^n}{f (n p+2) \sqrt {\cos ^2(e+f x)}}-\frac {b^2 \sin (e+f x) \cos (e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (n p+2)} \]
[In]
[Out]
Rule 2722
Rule 2868
Rule 2905
Rule 3093
Rubi steps \begin{align*} \text {integral}& = \left ((d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n\right ) \int (d \sin (e+f x))^{n p} (a+b \sin (e+f x))^2 \, dx \\ & = \left ((d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n\right ) \int (d \sin (e+f x))^{n p} \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx+\frac {\left (2 a b (d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n\right ) \int (d \sin (e+f x))^{1+n p} \, dx}{d} \\ & = -\frac {b^2 \cos (e+f x) \sin (e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (2+n p)}+\frac {2 a b \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (2+n p),\frac {1}{2} (4+n p),\sin ^2(e+f x)\right ) \sin ^2(e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (2+n p) \sqrt {\cos ^2(e+f x)}}+\left (\left (a^2+\frac {b^2 (1+n p)}{2+n p}\right ) (d \sin (e+f x))^{-n p} \left (c (d \sin (e+f x))^p\right )^n\right ) \int (d \sin (e+f x))^{n p} \, dx \\ & = -\frac {b^2 \cos (e+f x) \sin (e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (2+n p)}+\frac {\left (a^2+\frac {b^2 (1+n p)}{2+n p}\right ) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1+n p),\frac {1}{2} (3+n p),\sin ^2(e+f x)\right ) \sin (e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (1+n p) \sqrt {\cos ^2(e+f x)}}+\frac {2 a b \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (2+n p),\frac {1}{2} (4+n p),\sin ^2(e+f x)\right ) \sin ^2(e+f x) \left (c (d \sin (e+f x))^p\right )^n}{f (2+n p) \sqrt {\cos ^2(e+f x)}} \\ \end{align*}
Time = 0.31 (sec) , antiderivative size = 195, normalized size of antiderivative = 0.86 \[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=\frac {\sqrt {\cos ^2(e+f x)} \left (c (d \sin (e+f x))^p\right )^n \left (9 \left (6+5 n p+n^2 p^2\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1+n p),\frac {1}{2} (3+n p),\sin ^2(e+f x)\right )+b (1+n p) \sin (e+f x) \left (6 (3+n p) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},1+\frac {n p}{2},2+\frac {n p}{2},\sin ^2(e+f x)\right )+b (2+n p) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (3+n p),\frac {1}{2} (5+n p),\sin ^2(e+f x)\right ) \sin (e+f x)\right )\right ) \tan (e+f x)}{f (1+n p) (2+n p) (3+n p)} \]
[In]
[Out]
\[\int \left (c \left (d \sin \left (f x +e \right )\right )^{p}\right )^{n} \left (a +b \sin \left (f x +e \right )\right )^{2}d x\]
[In]
[Out]
\[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=\int { {\left (b \sin \left (f x + e\right ) + a\right )}^{2} \left (\left (d \sin \left (f x + e\right )\right )^{p} c\right )^{n} \,d x } \]
[In]
[Out]
\[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=\int \left (c \left (d \sin {\left (e + f x \right )}\right )^{p}\right )^{n} \left (a + b \sin {\left (e + f x \right )}\right )^{2}\, dx \]
[In]
[Out]
\[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=\int { {\left (b \sin \left (f x + e\right ) + a\right )}^{2} \left (\left (d \sin \left (f x + e\right )\right )^{p} c\right )^{n} \,d x } \]
[In]
[Out]
\[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=\int { {\left (b \sin \left (f x + e\right ) + a\right )}^{2} \left (\left (d \sin \left (f x + e\right )\right )^{p} c\right )^{n} \,d x } \]
[In]
[Out]
Timed out. \[ \int \left (c (d \sin (e+f x))^p\right )^n (3+b \sin (e+f x))^2 \, dx=\int {\left (c\,{\left (d\,\sin \left (e+f\,x\right )\right )}^p\right )}^n\,{\left (a+b\,\sin \left (e+f\,x\right )\right )}^2 \,d x \]
[In]
[Out]